<template>
    <div class="box">
        <h1>我是子组件son------我接收父组件传来的值为:{{messages}}</h1>
        <p><button @click="sendToFather">向父组件传值</button></p>
    </div>
</template>

<script>
    export default {
        name: "son",
        props:['messages'],
        data(){
            return{}
        },
        methods:{
            sendToFather(){
                this.$emit('listen',1520)
            }
        },
    }
</script>

<style scoped>
    h1{
        margin: 0 auto;
    }

</style>